/**
 * 给定一个圆与1000个点，三点不共线
 * 问随机取一个三角形与圆交点数量的期望是多少
 * 
 * 答案 = SIGMA{任取一个三角形交点的数量 * 概率}
 *     = SIGMA{任取一个三角形交点的数量} * 概率
 * 每条边一共取了N-2次，因此如果端点不在圆上的话
 * 答案 =  (N - 2) * SIGMA{每条边与圆的交点数量} * 概率
 * 如果有点在圆上，表示它被重复计算了。每个点都属于C(N-1, 2)个三角形，因此重复计算的数量是C(N-1, 2)
 * 因此答案是
 *     ((N - 2) * SIGMA{每条边的交点数量} - C(N-1, 2) * 圆上的点数) / C(N, 3)
 * 
 * 求线段与圆相交采用了一元二次方程根的数量，但是使用longlong做系数运算，应该是超了，只有25%
 * 将所有坐标类型改为实型就过了  
 */
#include <bits/stdc++.h>
#include <bits/extc++.h>
using namespace std;

using llt = long double;
using vi = vector<int>;
using vll = vector<llt>;
using pii = pair<int, int>;
using pll = pair<llt, llt>;
using Real = long double;

Real const EPS = 1E-9;
int sgn(Real x){return x > EPS ? 1 : (x < -EPS ? -1 : 0);}
bool is0(Real x){return 0 == sgn(x);}

struct point_t{
    llt x;
    llt y;
};

point_t Center;
llt Radius;

int N;
vector<point_t> Point;

int f(Real a, Real b, Real c){
    auto d = b * b - 4 * a * c;
    int tmp = sgn(d);
    if(tmp < 0) return 0;
    if(0 == tmp){
        auto x = -b / (a + a);
        if(0 <= sgn(x) and sgn(x - 1) <= 0) return 1;
        return 0;
    }

    int ans = 0;
    d = sqrt(d);
    auto x = (-b - d) / (a + a);
    if(0 <= sgn(x) and sgn(x - 1) <= 0) ans += 1;

    x = (-b + d) / (a + a);
    if(0 <= sgn(x) and sgn(x - 1) <= 0) ans += 1;

    return ans;
}

int inter(const point_t & A, const point_t & B){
    llt a = (B.x - A.x) * (B.x - A.x) + (B.y - A.y) * (B.y - A.y);
    llt b = 2 * ((B.x - A.x) * (A.x - Center.x) + (B.y - A.y) * (A.y - Center.y));
    llt c = (A.x - Center.x) * (A.x - Center.x) + (A.y - Center.y) * (A.y - Center.y) - Radius * Radius;
    int ans = f(a, b, c);
    return ans;
}

Real proc(){
    llt ans = 0;
    for(int i=0;i<N;++i){
        for(int j=0;j<N;++j)if(i!=j){
            ans += inter(Point[i], Point[j]);
        }
    } 

    // assert(0 == (ans & 1));
    // ans >>= 1;
    ans /= 2;

    int tmp = 0;
    for(const auto & p : Point){
        auto x = p.x - Center.x;
        auto y = p.y - Center.y;
        if(x * x + y * y == Radius * Radius) tmp += 1;
    }

    // ans = ans * (N - 2LL) - tmp * (N - 1LL) * (N - 2LL) / 2;
    Real t = ans * (N - 2.L) - tmp * (N - 1.L) * (N - 2.L) / 2.L;

    Real ret = 6.L * t / N / (N - 1.L) / (N - 2.L);
    return ret;
}

void work(){ 
    cin >> Center.x >> Center.y >> Radius >> N;
    Point.assign(N, {});
    for(auto & p : Point) cin >> p.x >> p.y; 
    cout << fixed << setprecision(12) << proc() << endl;
    return;
}

int main(){
#ifndef ONLINE_JUDGE
    freopen("z.txt", "r", stdin);
#endif
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);	
    int nofkase = 1;
	// cin >> nofkase;
	while(nofkase--) work();
	return 0;
}